<!--图书详情-->
<html>
<head>
    <meta charset="utf-8">
    <!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
    <!--<meta name="viewport" content="width=device-width, initial-scale=1">-->
    <title id="title_name">《 ${detail.name}》</title>
    <!--<link rel="stylesheet" href="css/bootstrap.min.css">-->
    <!--<script src="js/jquery-3.3.1.js"></script>-->
    <!--<script src="js/bootstrap.min.js" ></script>-->
    <!--<script src="js/getParameter.js"></script>-->
    <style>
        body{
            background-color: rgb(240,242,245);
        }
    </style>
    <script>
        $(function () {
            // var bookId = getParameter("bookId")
            var bookId = $.cookie("bookId");
            $.removeCookie("bookId");
            $.ajax({
                type:"post",
                url:"book/findDetail",
                data:{"bookId":bookId},
                dataType:"json",
                success:function (data) {
                    $("#title_name").html("《"+data.name+"》");
                    $("#h_name").html("《"+data.name+"》");

                    $("#td_name").html(data.name);
                    $("#td_author").html(data.author);
                    $("#td_publish").html(data.publish);
                    $("#td_isbn").html(data.isbn);
                    $("#td_introduction").html(data.introduction);
                    $("#td_language").html(data.language);
                    $("#td_price").html(data.price);
                    $("#td_pubdate").html(format(data.pubdate));
                    $("#td_classId").html(data.class_id);
                    $("#td_pressmark").html(data.pressmark);
                    if (data.state == 1){
                        $("#td_state").html("在馆");
                    }else if (data.state == 0) {
                        $("#td_state").html("借出");
                    }
                }
            })
        })
        function format(object) {
            var year = new Date(object).getFullYear(); //获取完整的年份(4位,1970-????)
            var month = new Date(object).getMonth() + 1; //获取当前月份(0-11,0代表1月)
            var day = new Date(object).getDate(); //获取当前日(1-31)
            if (month < 10) {
                month = "0" + month;
            }
            if (day < 10) {
                day = "0" + day;
            }
            var dateString =  year + "-" + month + "-" + day;
            return dateString;

        }
    </script>
</head>
<body>

<div class="col-xs-6 col-md-offset-3" style="position: relative;top: 10%">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 id="h_name" class="panel-title">《 ${detail.name}》</h3>
        </div>
        <div class="panel-body">
            <table class="table table-hover">
                <tr>
                    <th width="15%">书名</th>
                    <td id="td_name">${detail.name}</td>
                </tr>
                <tr>
                    <th>作者</th>
                    <td id="td_author">${detail.author}</td>
                </tr>
                <tr>
                    <th>出版社</th>
                    <td id="td_publish">${detail.publish}</td>
                </tr>
                <tr>
                    <th>ISBN</th>
                    <td id="td_isbn">${detail.isbn}</td>
                </tr>
                <tr>
                    <th>简介</th>
                    <td id="td_introduction">${detail.introduction}</td>
                </tr>
                <tr>
                    <th>语言</th>
                    <td id="td_language">${detail.language}</td>
                </tr>
                <tr>
                    <th>价格</th>
                    <td id="td_price">${detail.price}</td>
                </tr>
                <tr>
                    <th>出版日期</th>
                    <td id="td_pubdate">${detail.pubdate}</td>
                </tr>
                <tr>
                    <th>分类号</th>
                    <td id="td_classId">${detail.classId}</td>
                </tr>
                <tr>
                    <th>书架号</th>
                    <td id="td_pressmark">${detail.pressmark}</td>
                </tr>
                <tr>
                    <th>状态</th>
                    <!--<c:if test="${detail.state==1}">-->
                        <td id="td_state">在馆</td>
                    <!--</c:if>-->
                    <!--<c:if test="${detail.state==0}">-->
                        <!--<td>借出</td>-->
                    <!--</c:if>-->
                </tr>
                </tbody>
            </table>
        </div>
    </div>

</div>

</body>
</html>
